<template>
  <view class="content">
    <image class="logo" src="/static/logo.png"/>
    <view class="text-area">
      <text class="title flex">{{ title }}</text>
      <text class="title">{{ titles }}</text>
    </view>
    <up-loading-icon></up-loading-icon>
    <up-icon name="photo" color="#2979ff" size="28"></up-icon>
    <!--    <z-paging ref="paging" v-model="dataList" @query="queryList">-->
    <!--      <view class="item" v-for="(item,index) in dataList">-->
    <!--        <view class="item-title">{{item.title}}</view>-->
    <!--      </view>-->
    <!--    </z-paging>-->
    <input type="digit" v-model="titles" @input="getDoubleFixed">
  </view>
</template>

<script setup lang="ts">
// import {onLoad} from "@dcloudio/uni-app";
import {doubleFixed, isValid} from "@/utils/verify";

const title = ref('Hello')
const titles = ref()
onLoad(() => {
  console.log('onload')
})
const dataList = ref([])
const paging = ref<ZPagingInstance>();

const queryList: ZPagingEvent.Query = (pageNo: number, pageSize: number) => {
  paging.value?.complete([]);
}

const getDoubleFixed = async (event: InputEvent) => {
  const fixedValue = await doubleFixed(event, 2);
  titles.value = fixedValue
  return fixedValue
}

</script>

<style>
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo {
  height: 200rpx;
  width: 200rpx;
  margin-top: 200rpx;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 50rpx;
}

.text-area {
  display: flex;
  justify-content: center;
}

.title {
  font-size: 36rpx;
  color: #8f8f94;
}
</style>
